import { postRequest, getRequest } from '/src/lib/axios';
export const assetManagement = {
  query: (param) => {
    return postRequest('/carbonAssets/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'asset_id',
        },
      ],
    });
  },
  Add: (param) => {
    return postRequest('/carbonAssets/add', param);
  },
  Update: (param) => {
    return postRequest('/carbonAssets/update', param);
  },
  Delete: (param) => {
    return getRequest(`/carbonAssets/delete/${param}`);
  },
  queryGHG: (param) => {
    return postRequest('/ghgProtocolScope/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'ghg_id',
        },
      ],
    });
  },
  queryISO: (param) => {
    return postRequest('/isoCategory/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'iso_id',
        },
      ],
    });
  },
  queryIndustry: (param) => {
    return postRequest('/industry/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'industry_id',
        },
      ],
    });
  },
  queryEco: (param) => {
    return postRequest('/eco/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'eco_id',
        },
      ],
    });
  },
  queryAssetsCategory: (param) => {
    return postRequest('/carbonAssetsCategory/queryPage', {
      ...param,
      searchCount: true,
      sortItemList: [
        {
          isAsc: true,
          column: 'ca_category_id',
        },
      ],
    });
  },
};
